<template>
  <div>
     <el-tree :data="deptList" node-key="deptId"
     :default-expand-all="true"
     :props="{label:'deptName'}">

     </el-tree>
  </div>
</template>
<script setup>
  import {listDept} from '@/api/system/dept'
import {ref} from 'vue'
import {handleTree} from '@/utils/ruoyi'
let deptList=ref([])

  let getDeptList= async ()=>{
    let res = await listDept()
    deptList.value=handleTree(res.data,"deptId","parentId")//岗位列表
    console.log( deptList.value,"----------")
  }
  getDeptList()
</script>